package com.vegetable.modules.entity.stock.po;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.vegetable.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 库存预警设置新增/修改对象
 * </p>
 *
 * @author wangruijie
 * @since 2024-09-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="StockAlertSavePO", description="库存预警设置新增/修改对象")
public class StockAlertSavePO extends BaseEntity {

    @ApiModelProperty(value = "商品ID", required = true)
    @NotNull(message = "商品ID不能为空")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long commodityId;

    @ApiModelProperty(value = "规格ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long specsId;

    @ApiModelProperty(value = "预警数量阈值", required = true)
    @NotNull(message = "预警数量阈值不能为空")
    @Min(value = 0, message = "预警数量阈值不能小于0")
    private Integer alertQuantity;

    @ApiModelProperty(value = "是否启用预警：0否1是")
    private Integer isEnabled = 1;

    @ApiModelProperty(value = "预警级别：1低级2中级3高级")
    private Integer alertLevel = 2;

    @ApiModelProperty(value = "台账标识 0寿光 1河北")
    private Integer regionId = 0;
}